#pragma once
#include <BWAPI.h>
#include <BWTA.h>
#include "Potential.h"
using namespace BWAPI;

// Stores data on threats on the game map and calculates locally optimum path for unit based on potential fields.  Because land units can get stuck against walls,
// this is most useful for air units and land units in open areas such as bases.
class ThreatMap
{
  public:
    // Class methods
    static ThreatMap* create();
    static void destroy();
    Position* calculateMove(BWAPI::Unit* unit,std::list<Potential*> potentials); // Calculate where a given unit should move to based on the potential fields on the map.
    double epsilon; // Value of potential field used to calculate variable controlling width

  private:
    ThreatMap();
    // Data on damage and armor bonuses observed for each type.
    std::map<BWAPI::UnitType*,int> dmgBonus;
    std::map<BWAPI::UnitType*,int> armorBonus;
};
extern ThreatMap* TheThreatMap; // Singleton
